function cellInfo = Pilot_Cmd_Bus(varargin) 
% PILOT_CMD_BUS returns a cell array containing bus object information 
% 
% Optional Input: 'false' will suppress a call to Simulink.Bus.cellToObject 
%                 when the MATLAB file is executed. 
% The order of bus element attributes is as follows:
%   ElementName, Dimensions, DataType, SampleTime, Complexity, SamplingMode, DimensionsMode, Min, Max, DocUnits, Description 

suppressObject = false; 
if nargin == 1 && islogical(varargin{1}) && varargin{1} == false 
    suppressObject = true; 
elseif nargin > 1 
    error('Invalid input argument(s) encountered'); 
end 

cellInfo = { ... 
  { ... 
    'Pilot_Cmd_Bus', ... 
    '', ... 
    '', ... 
    'Auto', ... 
    '-1', {... 
{'timestamp', 1, 'uint32', -1, 'real', 'Sample', 'Fixed', [], [], sprintf('ms'), ''}; ...
{'stick_yaw', 1, 'single', -1, 'real', 'Sample', 'Fixed', -1, 1, '', sprintf('Stick value of yaw channel')}; ...
{'stick_throttle', 1, 'single', -1, 'real', 'Sample', 'Fixed', -1, 1, '', sprintf('Stick value of throttle channel')}; ...
{'stick_roll', 1, 'single', -1, 'real', 'Sample', 'Fixed', -1, 1, '', sprintf('Stick value of roll chanel')}; ...
{'stick_pitch', 1, 'single', -1, 'real', 'Sample', 'Fixed', -1, 1, '', sprintf('Stick value of pitch channel')}; ...
{'mode', 1, 'uint32', -1, 'real', 'Sample', 'Fixed', [], [], '', ''}; ...
{'cmd_1', 1, 'uint32', -1, 'real', 'Sample', 'Fixed', [], [], '', sprintf('Operation channel 1')}; ...
{'cmd_2', 1, 'uint32', -1, 'real', 'Sample', 'Fixed', [], [], '', sprintf('Operation channel 2')}; ...
    } ...
  } ...
}'; 

if ~suppressObject 
    % Create bus objects in the MATLAB base workspace 
    Simulink.Bus.cellToObject(cellInfo) 
end 
